﻿#region

using System;
using System.Linq;
using System.Web.Security;
using System.Web.UI;

#endregion

namespace FastTrackCabService.AdminPanel
{
    public partial class AdminSite : MasterPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.QueryString["action"] == "logout")
            {
                FormsAuthentication.SignOut();
                Response.Redirect("~/AdminLogin.aspx");
            }

            string[] roles = Roles.GetRolesForUser(Page.User.Identity.Name);

            liSubsidiaries.Visible =
                liOperators.Visible =
                    liReport.Visible = roles.Contains("Manager");
        }
    }
}